package com.wyl.tcp

import java.net.Socket

/**
 * TCP通讯客户端Socket实现
 */
fun main() {
    Socket("127.0.0.1", 9999).use {
        it.getOutputStream().use { ops ->
            ops.write("你好".toByteArray())
        }
        it.getInputStream().use { ips ->
            println(String(ips.readBytes()))
        }
    }
}